
# 导入第三方库
import requests
from lxml import etree

def wangyi():
    # 写入请求网址
    url = "https://news.163.com/special/cm_war/"
    params = {
    "callback": "data_callback"
}
    # 模拟浏览器
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.54'
    }
    r = requests.get(url, params=params, headers=headers).text
    print(r)
    # 转换数据类型
    ret = etree.HTML(r)



if __name__ == '__main__':
    wangyi()